﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace EasyFlow
{
    public static class TreeViewHelper
    {
        public static void ScrollToNode(this TreeView treeView, object node)
        {
            if (treeView == null || node == null)
                return;

            TreeViewItem item = treeView.ItemContainerGenerator.ContainerFromItem(node) as TreeViewItem;
            if (item != null)
            {
                item.BringIntoView();
            }
        }
    }
}
